#ifndef     __HEAD_H
#define     __HEAD_H

#include<stdio.h>
#include<pthread.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<netinet/in.h>
#include<stdlib.h>
#include<arpa/inet.h>
#include<unistd.h>
#include<time.h>
#include<string.h>
#include<mysql/mysql.h>
#include<stdint.h>
#include<sys/select.h>

typedef struct info{
    int option;
    int who;
    int id;
    char name[10];
    char pass[10];
}requst;

typedef struct who
{
    int n;              //确定是管理员还是用户
    int ret;
}people;

typedef struct POINT
{
    char district[10];
    char film[10];
    int  phone;
    char location[24];
}point;

typedef struct TRACE
{
    int id;
    char location[16];
    char status[6];
}trace;

typedef struct FLOW
{
    int f_id;
    int u_id;
    char origin[16];
    char end[16];
    char del[16];
    char rec[16];
    char time[20];
    char loc [16];
    char film[16];
    char sit[3];
}flow;

typedef struct FEE
{
    int c;
    char film[10];
    char time[32];
}fee;

void test_2(char *str1, char *str2);
int user_menu(int sockfd,int id);
int user(int sockfd);
int admin_menu(int sockfd,int id);
int admin(int sockfd);
void which_(int sockfd,int i);
int menu(int sockfd);
int sign_up(int sockfd,int n);
int sign_in(int sockfd,int n);
int domenu_1();
int domenu_2();


void search_id(int sockfd,int id);
void search_point(int sockfd,int id);
void search_fee(int sockfd,int id);
void search_location(int sockfd,int id);
int modfiy_user(int sockfd,int id);

void search_all_info(int sockfd,int id);
void receive(int sockfd);
void insert_info(int sockfd,int id);
void deliver_flow(int sockfd);
void update_info(int sockfd,int id);
void update_flow(int sockfd);
void delete_info(int sockfd,int id);
void delete_flow(int sockfd);
void add_admin(int sockfd);

void my_system();

#endif